home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Animation How-To
/
Animation How-to CD.iso
/
PLY
/
CHAPTER4
/
JELLYDIM
/
JELLYDIM.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-01-01
|
3KB
|
133 lines
' JELLYDIM.BAS
' Jellyfish Diamond Motion File
TYPE vector
x AS SINGLE
y AS SINGLE
z AS SINGLE
END TYPE
pi = 3.1415926536#
radians = 180 / pi
DIM vertex(42) AS vector, triangle(3) AS vector
DIM red(16), green(16), blue(16)
pref$ = "\ply\dat\jellydim\diam"
' set the screen up with pretty rainbow colors
SCREEN 12
zoom = .015
xoff = 320
yoff = 240
WINDOW ((0 - xoff) * zoom, (0 - yoff) * zoom)-((639 - xoff) * zoom, (479 - yoff) * zoom)
FOR y = 1 TO 4
FOR x = 1 TO 4
colornum = x + ((y - 1) * 4) - 1
READ red(colornum), green(colornum), blue(colornum)
KOLOR = 65536 * blue(colornum) + 256 * green(colornum) + red(colornum)
PALETTE colornum, KOLOR
COLOR colornum
NEXT x
NEXT y
'Rainbow Palette
DATA 0, 0, 0
DATA 32, 0, 0
DATA 42, 0, 0
DATA 58, 16, 0
DATA 63, 32, 0
DATA 58, 56, 0
DATA 16, 42, 0
DATA 0, 30, 36
DATA 0, 20, 40
DATA 0, 10, 48
DATA 0, 0, 63
DATA 20, 0, 53
DATA 23, 0, 29
DATA 19, 7, 17
DATA 50, 40, 45
DATA 63, 63, 63
pi = 3.1415926535#
rad = pi / 180
radius1 = 1
radius2 = 1.4
radius3 = 1.8
radius4 = .7
radius5 = .01
ht1 = 1
ht2 = .8
ht3 = .5
ht4 = -.5
ht5 = -1
masteramp = 1.3
ampl1 = .03 * masteramp
ampl2 = .02 * masteramp
ampl3 = .01 * masteramp
ampl4 = .04 * masteramp
ampl5 = .05 * masteramp
phase = 80 'hump phase
phase1 = 0
phase2 = 25
phase3 = 50
phase4 = 75
phase5 = 87
aspect = .1 ' control the size of the ellipses in the simplified model
bump = 1
wave = 4
DO WHILE INKEY$ = ""
ang = ang + 10
height1 = ht1 + ampl1 * (wave * COS(rad * (ang - phase1)) + EXP(bump * (1 + COS((ang - phase - phase1) * rad))))
height2 = ht2 + ampl2 * (wave * COS(rad * (ang - phase2)) + EXP(bump * (1 + COS((ang - phase - phase2) * rad))))
height3 = ht3 + ampl3 * (wave * COS(rad * (ang - phase3)) + EXP(bump * (1 + COS((ang - phase - phase3) * rad))))
height4 = ht4 + ampl4 * (wave * COS(rad * (ang - phase4)) + EXP(bump * (1 + COS((ang - phase - phase4) * rad))))
height5 = ht5 + ampl5 * (wave * COS(rad * (ang - phase5)) + EXP(bump * (1 + COS((ang - phase - phase5) * rad))))
newradius1 = radius1 * height1
newradius2 = radius2 * height2 * 1.3
newradius3 = radius3 * height3 * 2
newradius4 = radius4 * (1.5 + height4)
newradius5 = radius5
CIRCLE (0, h1old), r1old, 0, , , aspect
CIRCLE (0, h2old), r2old, 0, , , aspect
CIRCLE (0, h3old), r3old, 0, , , aspect
CIRCLE (0, h4old), r4old, 0, , , aspect
CIRCLE (0, h5old), r5old, 0, , , aspect
CIRCLE (0, height1), newradius1, 2, , , aspect
CIRCLE (0, height2), newradius2, 3, , , aspect
CIRCLE (0, height3), newradius3, 4, , , aspect
CIRCLE (0, height4), newradius4, 5, , , aspect
CIRCLE (0, height5), newradius5, 6, , , aspect
h1old = height1
h2old = height2
h3old = height3
h4old = height4
h5old = height5
r1old = newradius1
r2old = newradius2
r3old = newradius3
r4old = newradius4
r5old = newradius5
LOOP